package com.controller;

import com.pojo.Menu;
import com.service.MenuService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sys/menu")
public class MenuHandler {
    @Resource
    private MenuService menuService;
    @RequestMapping("/getMenu")
    public Menu getMenu(Integer mid){
        return menuService.getMenu(mid);
    }
    @RequestMapping("/updateMenu")
    public String updateMenu(Menu menu){
        String msg="修改失败！";
        int i = menuService.updateMenu(menu);
        if (i > 0) {
            msg="修改成功！";
        }
        return msg;
    }
}
